import type { MapItem } from '@/map-item'
import type { Entity } from './types'
import { getEntity } from './core'

export function entityMapItemType(type: string) {
  return 'Entity:' + type
}

export function entityMapItem<T extends Entity>(type: string, id: string): MapItem<T> {
  return {
    type: entityMapItemType(type),
    item: getEntity(type, id)!
  }
}
